Optimal. Leaf size=164 \[ \frac {A \sec ^{-n}(c+d x) (a+a \sec (c+d x))^n \sin (c+d x)}{d (1+n)}+\frac {(B+A n+B n) \, _2F_1\left (\frac {1}{2}-n,-n;1-n;-\frac {2 \sec (c+d x)}{1-\sec (c+d x)}\right ) \sec ^{1-n}(c+d x) \left (\frac {1+\sec (c+d x)}{1-\sec (c+d x)}\right )^{\frac {1}{2}-n} (a+a \sec (c+d x))^n \sin (c+d x)}{d n (1+n) (1+\sec (c+d x))} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.16, antiderivative size = 164, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 4, integrand size = 35, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.114, Rules used = {4098, 3913,
3910, 134} \begin {gather*} \frac {(A n+B n+B) \sin (c+d x) \sec ^{1-n}(c+d x) \left (\frac {\sec (c+d x)+1}{1-\sec (c+d x)}\right )^{\frac {1}{2}-n} (a \sec (c+d x)+a)^n \, _2F_1\left (\frac {1}{2}-n,-n;1-n;-\frac {2 \sec (c+d x)}{1-\sec (c+d x)}\right )}{d n (n+1) (\sec (c+d x)+1)}+\frac {A \sin (c+d x) \sec ^{-n}(c+d x) (a \sec (c+d x)+a)^n}{d (n+1)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 134
Rule 3910
Rule 3913
Rule 4098
Rubi steps
\begin {align*} \int \sec ^{-1-n}(c+d x) (a+a \sec (c+d x))^n (A+B \sec (c+d x)) \, dx &=\frac {A \sec ^{-n}(c+d x) (a+a \sec (c+d x))^n \sin (c+d x)}{d (1+n)}+\frac {(B+A n+B n) \int \sec ^{-n}(c+d x) (a+a \sec (c+d x))^n \, dx}{1+n}\\ &=\frac {A \sec ^{-n}(c+d x) (a+a \sec (c+d x))^n \sin (c+d x)}{d (1+n)}+\frac {\left ((B+A n+B n) (1+\sec (c+d x))^{-n} (a+a \sec (c+d x))^n\right ) \int \sec ^{-n}(c+d x) (1+\sec (c+d x))^n \, dx}{1+n}\\ &=\frac {A \sec ^{-n}(c+d x) (a+a \sec (c+d x))^n \sin (c+d x)}{d (1+n)}+\frac {\left ((B+A n+B n) (1+\sec (c+d x))^{-\frac {1}{2}-n} (a+a \sec (c+d x))^n \tan (c+d x)\right ) \text {Subst}\left (\int \frac {(1-x)^{-1-n} (2-x)^{-\frac {1}{2}+n}}{\sqrt {x}} \, dx,x,1-\sec (c+d x)\right )}{d (1+n) \sqrt {1-\sec (c+d x)}}\\ &=\frac {A \sec ^{-n}(c+d x) (a+a \sec (c+d x))^n \sin (c+d x)}{d (1+n)}+\frac {(B+A n+B n) \, _2F_1\left (\frac {1}{2}-n,-n;1-n;-\frac {2 \sec (c+d x)}{1-\sec (c+d x)}\right ) \sec ^{1-n}(c+d x) \left (\frac {1+\sec (c+d x)}{1-\sec (c+d x)}\right )^{\frac {1}{2}-n} (a+a \sec (c+d x))^n \sin (c+d x)}{d n (1+n) (1+\sec (c+d x))}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 1.16, size = 111, normalized size = 0.68 \begin {gather*} \frac {\left (A+\frac {(B+A n+B n) \left (-\cot ^2\left (\frac {1}{2} (c+d x)\right )\right )^{\frac {1}{2}-n} \, _2F_1\left (\frac {1}{2}-n,-n;1-n;\csc ^2\left (\frac {1}{2} (c+d x)\right )\right )}{n (1+\cos (c+d x))}\right ) \sec ^{-n}(c+d x) (a (1+\sec (c+d x)))^n \sin (c+d x)}{d (1+n)} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [F]
time = 0.52, size = 0, normalized size = 0.00 \[\int \left (\sec ^{-1-n}\left (d x +c \right )\right ) \left (a +a \sec \left (d x +c \right )\right )^{n} \left (A +B \sec \left (d x +c \right )\right )\, dx\]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {\left (A+\frac {B}{\cos \left (c+d\,x\right )}\right )\,{\left (a+\frac {a}{\cos \left (c+d\,x\right )}\right )}^n}{{\left (\frac {1}{\cos \left (c+d\,x\right )}\right )}^{n+1}} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________